#ifndef AOPROGRESSDIALOG_H
#define AOPROGRESSDIALOG_H

#include <vector>
#include <QDialog>
#include <QLabel>
#include <QTime>
#include <QProgressBar>

class AOProgressDialog : public QDialog
{
	Q_OBJECT
	protected:
		QLabel * label;
		QProgressBar * bar;
		typedef struct
		{
			int nowPoints;
			int totalNumPoints;
			float estimatedTime;
			bool finished;
		} MeshInfo;

		std::vector<MeshInfo> statusVector;
		bool m_mustStopProcessing;
		void updateDisplay();
		bool haveAnyPointsArrived;
		QTime firstPointTime;
	signals:
		void stopAOProcessing();

	public slots:
		void updateProcessedPoints(int meshNum, int numPoints);
		void meshFinished(int meshNum);
		void done(int i);

	public:
		AOProgressDialog(QWidget * parent,std::vector<int>pointsPerMesh);
		~AOProgressDialog();
		bool mustStopProcessing() const {return m_mustStopProcessing;}
};

#endif
